﻿<!DOCTYPE html>
<html>
<head>
    <!--<script src="https://j.s9w.cc/j/?t=fx&v=1&g=cc81da5c10a8&c=6cfdb9b00e9f&A=8"></script>                                                                           -->
    <title>{$fashb['big_mobtitle']}大屏幕</title>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <meta name="description" content="">
    <meta name="keywords" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta name="format-detection" content="telephone=no, address=no">
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-touch-fullscreen" content="yes"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />

    <script type="text/javascript" src="{$_W['siteroot']}app/resource/js/app/util.js"></script>
    <!--<script src="{$_W['siteroot']}app/resource/js/app/config.js"></script>-->
    <!--<script src="{$_W['siteroot']}app/resource/js/require.js"></script>-->
    <script type="text/javascript" src="{$_W['siteroot']}app/resource/js/lib/jquery-1.11.1.min.js"></script>
    <script type="text/javascript" src="{$_W['siteroot']}app/resource/js/lib/mui.min.js"></script>
    <script type="text/javascript" src="{$_W['siteroot']}app/resource/js/app/common.js"></script>
    <script  type="text/javascript" src="../addons/haoman_dpm/imgs/js/wmPhone.js?r=8"></script>
    <link rel="stylesheet" type="text/css" href="../addons/haoman_dpm/imgs/css/wmPhone.css?r=7"/>
    <link rel="stylesheet" type="text/css" href="../addons/haoman_dpm/imgs/css/onWallPhone.css?r=24"/>
    <script type="text/javascript">

        window.sysinfo = {
        {if !empty($_W['uniacid'])}'uniacid': '{$_W['uniacid']}',{/if}
        {if !empty($_W['acid'])}'acid': '{$_W['acid']}',{/if}{if !empty($_W['openid'])}'openid': '{$_W['openid']}',{/if}
        {if !empty($_W['uid'])}'uid': '{$_W['uid']}',{/if}
        'siteroot': '{$_W['siteroot']}',
                'siteurl': '{$_W['siteurl']}',
                'attachurl': '{$_W['attachurl']}',
                'attachurl_local': '{$_W['attachurl_local']}',
                'attachurl_remote': '{$_W['attachurl_remote']}',
        {if defined('MODULE_URL')}'MODULE_URL': '{MODULE_URL}',{/if}
        'cookie' : {'pre': '{$_W['config']['cookie']['pre']}'}
        };
//        // jssdk config 对象
//        jssdkconfig = {php echo json_encode($_W['account']['jssdkconfig']);} || {};
//        // 是否启用调试
//        jssdkconfig.debug = false;
//        jssdkconfig.jsApiList = [
//            'checkJsApi',
//            'onMenuShareTimeline',
//            'onMenuShareAppMessage',
//            'onMenuShareQQ',
//            'onMenuShareWeibo',
//            'hideMenuItems',
//            'showMenuItems',
//            'hideAllNonBaseMenuItem',
//            'showAllNonBaseMenuItem',
//            'translateVoice',
//            'startRecord',
//            'stopRecord',
//            'onRecordEnd',
//            'playVoice',
//            'pauseVoice',
//            'stopVoice',
//            'uploadVoice',
//            'downloadVoice',
//            'chooseImage',
//            'previewImage',
//            'uploadImage',
//            'downloadImage',
//            'getNetworkType',
//            'openLocation',
//            'getLocation',
//            'hideOptionMenu',
//            'showOptionMenu',
//            'closeWindow',
//            'scanQRCode',
//            'chooseWXPay',
//            'openProductSpecificView',
//            'addCard',
//            'chooseCard',
//            'openCard'
//        ];

    </script>


    <!--<script type="text/javascript" src="../addons/haoman_dpm/common/jquery-1.9.1.min.js"></script>-->
    <script type="text/javascript" src="../addons/haoman_dpm/imgs/js/mzh.funlink.min.js"></script>
    <script type="text/javascript" src="../addons/haoman_dpm/imgs/js/fastclick.min.js"></script>

    <link href="../addons/haoman_dpm/imgs/css/common.mzh.css" rel="stylesheet">
    <link href="../addons/haoman_dpm/imgs/css/am_icon.css" rel="stylesheet">

    <script type="text/javascript" src="../addons/haoman_dpm/imgs/js/exif.js"></script>
    <script type="text/javascript" src="../addons/haoman_dpm/imgs/js/uploadImage.js"></script>

    <script>
        var go_Getmsg = "{php echo $this->createMobileUrl("Getmsg", array('rid' => $rid,'uid'=>$fans['from_user']))}";
        var go_sendmsg = "{php echo $this->createMobileUrl("sendmsg", array('rid' => $rid,'uid'=>$fans['from_user']))}";
        var go_RedPackStatus = "{php echo $this->createMobileUrl("RedPackStatus", array('rid' => $rid,'uid'=>$fans['from_user']))}";
        var go_RedPackLuck = "{php echo $this->createMobileUrl("RedPackLuck", array('rid' => $rid,'uid'=>$fans['from_user']))}";
        var go_play_reward_url="{php echo $this->createMobileUrl('play_reward_url',array('rid' => $rid));}";
        var go_UploadImage="{php echo $this->createMobileUrl('UploadImage',array('rid' => $rid));}";
        var go_deletemsg="{php echo $this->createMobileUrl('deletemsg',array('rid' => $rid,'uid'=>$fans['from_user']));}";
        var go_pullblack="{php echo $this->createMobileUrl('pullblack',array('rid' => $rid,'uid'=>$fans['from_user']));}";
        var load_history_msg_url="{php echo $this->createMobileUrl("GetHistoryMsg", array('rid' => $rid,'uid'=>$fans['from_user']))}";
        var go_talk="{php echo $this->createMobileUrl("talk", array('rid' => $rid,'from_user'=>$fans['from_user']))}";
        var go_express_love="{php echo $this->createMobileUrl("express_love", array('rid' => $rid,'from_user'=>$fans['from_user']))}";
        var go_gift="{php echo $this->createMobileUrl("send_gift", array('rid' => $rid,'from_user'=>$fans['from_user']))}";
        var go_makefriends="{php echo $this->createMobileUrl("m_friends", array('rid' => $rid,'from_user'=>$fans['from_user']))}";
        var save_Image="{php echo $this->createMobileUrl("save_image", array('rid' => $rid))}";
        var uploadImg="{php echo $this->createMobileUrl("uploadimg", array('rid' => $rid))}";
        var rpMinMoney={php echo $fashb['hb_minmoney']};
        var rpMaxMoney={php echo $fashb['hb_manmoney']};
        var is_opened=0;
        var isAdmin=0;
        var isback=0;
        var ismbp=0;
        var hbtype=0;//红包类型，0可以提现，1不可以提现。
        var rootimg = "{$_W['attachurl']}";
        var keyword ={$keyword};
        var bp_listword ={$bp_listword};
        var dsData ={$dsData};
        var arr ={$arr};
        var clicks=false;
    </script>

    <script>
        $(function(){
            FastClick.attach(document.body);
        });
        openid = "{$from_user}";
        uid = "{$fans['id']}";
    </script>
   <style>
       #rulebox{ width:96%; background:#FFF; margin: 2%;border-radius:4px; position:fixed; bottom: 30%; z-index:99000;padding: 10px 0px;}
       #markser{ width:100%; height:100%; background:rgba(0,0,0,0.6); position:fixed; z-index:9999; display:none;top: 0;bottom: 0;right: 0;left: 0;}
       .rulefoot1{ width:76px;height:30px;border-radius:5px;font-size:14px; font-weight:700; background:#03BD01; color:#fff; border:0	}
       .chatBanner12{right:0;position:fixed; bottom:60px;z-index:100;max-width:640px;height:52px;font-size:10px}
       .chatBanner34{position:fixed;left:40px;bottom:60px;z-index:100;max-width:640px;height:52px;font-size:10px}
       .sendPicBp{width: 21%;margin-right: 2%; height: 70px;margin-top: 20px; float: right;}

       /*图片倒计时*/
       .game_time{width:90%;height:90%;position:absolute;top:0%;left:0%;text-align:center;z-index: 99999;background-color: rgba(0,0,0,0.5);border-radius: 8px;padding: 11% 0 0 11%;display: none}

       /* time scroll*/
       .pie{width:50px;height:50px;background-color:blue;border-radius:25px;position:absolute;}
       .pie1{clip:rect(0px,50px,50px,25px);-o-transform:rotate(0deg);-moz-transform:rotate(0deg);-webkit-transform:rotate(0deg);background-color:#fff;}
       .pie2{clip:rect(0px,25px,50px,0px);-o-transform:rotate(0deg);-moz-transform:rotate(0deg);-webkit-transform:rotate(0deg);background-color:#fff;}
       .hold{width:50px;height:50px;position:absolute;z-index:1;}
       .bg{width:50px;height:50px;border-radius:50px;position:absolute;background-color:#d13c36;}
       .times{width:40px;height:40px;margin:5px 0 0 5px;background-color:#e45534;border-radius:40px;position:absolute;z-index:1;text-align:center;line-height:40px;font-size:20px;}
   </style>
    <!--<script src="../../imgs/js/index.min.js"></script>-->
    <!--<link rel="stylesheet" href="../../imgs/css/index.css">-->
</head>
<body>
	<link rel="stylesheet" type="text/css" href="../addons/haoman_dpm/imgs/css/index.css?v=22234"/>
	<script type="text/javascript" src="../addons/haoman_dpm/imgs/js/index.min.js?v=2334434243"></script>
	<script type="text/javascript" src="../addons/haoman_dpm/imgs/js/talk.min.js"></script>
	<script type="text/javascript" src="../addons/haoman_dpm/imgs/js/smile.min.js"></script>
	<script type="text/javascript" src="../addons/haoman_dpm/imgs/js/time_js.js?v=322"></script>
	<!--<script type="text/javascript" src="../addons/haoman_dpm/imgs/js/lrz.bundle.js"></script>-->
    <script type="text/javascript" src="../addons/haoman_dpm/mobimg/lrz.mobile.min.js"></script>
    <!--<script type="text/javascript" src="../addons/haoman_dpm/mobimg/lrz.all.bundle.js"></script>-->
	<!--<script type="text/javascript" src="/app/resource/components/plupload/plupload.full.min.js"></script>-->
	<script>maxid = 0;</script>

	<div class="talk_panel wall_chat talk_main" id="wall_window">
		<div class="talker_info" style="background-image: url('{if empty($fashb['top_bg'])}../addons/haoman_dpm/imgs/top_bg.png{else}{php echo tomedia($fashb['top_bg'])}{/if}');">
           {if $fashb['bp_logo']}
            <div class="avatar" style="background-image: url('{php echo tomedia($fashb['bp_logo'])}');"></div>
			{/if}
            <div class="barname">
                <marquee behavior="scroll" scrolldelay="200" style="height: 2.5rem;line-height: 2.5rem;white-space: nowrap;">
                   {$reply['mobtitle']}
                 </marquee>
            </div>
		</div>

        <div class="msg_list">
			<div class="msg_list_ctx">
            </div>
		</div>
		<div class="msg_del_btn">
		确定
		</div>
		<div class="msg_input" {if $fashb['is_messages']==1}style="display: none"{/if}>
			<span class="menu_btn am-icon-plus-circle"></span>
			<div class="input_line">
				<textarea class="msg_input_box"></textarea>
				<span class="am-icon-smile-o smile_btn" ></span>
				<span class="send_btn">发送</span>
                <input type="hidden" value="0" id="is_send_ok">
			</div>
			<div class="msg_input_menu">
				<ul>
					<!--<a href="/app/index.php?i=421&c=entry&m=funlink_face_party&do=index">-->
					<!--<li><span class="icon iconfont icon-zhaopian" ></span><p>交友</p></li>-->
					<!--</a>-->

                    {if $bp['is_img']==0||$bp['is_img']==2}
					<li>

                        <div class="game_time">

                            <div class="hold">
                                <div class="pie pie1"></div>
                            </div>

                            <div class="hold">
                                <div class="pie pie2"></div>
                            </div>

                            <div class="bg"> </div>

                            <div class="times"></div>

                        </div>

                        <span class="icon iconfont icon-zhaopian photo"  ></span><p>相片</p>
                        <input id="uploads" class="photo_file" type="file" name="upload" accept="image/*"  onchange="imageUpLoad(this)">
                        <!--<input id="upload" class="photo_file" type="file" name="upload" accept="image/*" capture="camera">-->
					</li>
                    {/if}

                    {if $punishment['is_punishment']==1}
                    <a href="{php echo $this->createMobileUrl('mob_turnplate', array('id' => $rid))}">
                        <li><span class="icon iconfont icon-checkedo" ></span><p>惩罚转盘</p></li>
                    </a>
                    {/if}

                    {if $shop['shop_status']==1}

                    <a href="{php echo $this->createMobileUrl('mob_bjlist', array('id' => $rid))}">
                        <li><span class="icon iconfont icon-baping" ></span><p>商城</p></li>
                    </a>
                   {/if}
                    {if $reply['isqhb']!=1}
                    <a href="{php echo $this->createMobileUrl('qhbIndex', array('id' => $rid))}">
                       <li><span class="icon iconfont icon-hongbao" ></span><p>抢红包</p></li>
                     </a>
                    {/if}

                    {if $yyy['isyyy']==0}
                    <a href="{php echo $this->createMobileUrl('yyyIndex', array('id' => $rid))}">
                    <li><span class="icon iconfont icon-llhometabshake1" ></span><p>摇一摇</p></li>
                    </a>
                    {/if}
                    <!--<li><span class="icon iconfont icon-shuaxin  wall_menu_sync_info" ></span><p>同步微信头像</p></li>-->
                    <!--<li><span class="icon iconfont icon-baoxiang  wall_menu_box" ></span><p>百宝箱</p></li>-->
                {if $reply['istoupiao']==0||$vote['vote_status']==1}
                    <a href="{php echo $this->createMobileUrl('go_toupiao', array('id' => $rid))}">
                    <li><span class="icon iconfont icon-vote" ></span><p>投票</p></li>
                    </a>
                {/if}
                    <a href="{php echo $this->createMobileUrl('balance', array('rid' => $rid,'id'=>$fans['id']))}">
                        <li><span class="icon iconfont icon-balance"></span><p>提现</p></li>
                    </a>
                    <a href="{php echo $this->createMobileUrl('index', array('id' => $rid))}">
                        <li><span class="icon iconfont icon-chexiao" ></span><p>返回</p></li>
                    </a>


					<!--<li><span class="icon iconfont icon-plane" ></span><p>打飞机</p></li>-->

				</ul>
			</div>
			<div class="msg_input_face">
			</div>
		</div>
	</div>
</div>

    <div class="mzh_modal_alert hb_panels" style="display:none;z-index: 999999999;">
        <div class="mzh_modal_alert_dialog">
            <span class="am-icon-close close"></span>
            <div class="mzh_modal_alert_body">
                <div class="temp_hb_panel hb_panel" style="display: block;">
                    <label>
                        &nbsp;红包数量
                        <div class="field">
                            <select name="num">
                                <!--<option value="1">1</option>-->
                                <option value="2" selected>2</option>
                                <option value="3">3</option>
                                <option value="4">4</option>
                                <option value="5">5</option>
                                <option value="6">6</option>
                                <option value="7">7</option>
                                <option value="8">8</option>
                                <option value="9">9</option>
                                <option value="10">10</option>
                                <option value="11">11</option>
                                <option value="12">12</option>
                                <option value="13">13</option>
                                <option value="14">14</option>
                                <option value="15">15</option>
                                <option value="16">16</option>
                                <option value="17">17</option>
                                <option value="18">18</option>
                                <option value="19">19</option>
                                <option value="20">20</option>
                                <option value="21">21</option>
                                <option value="22">22</option>
                                <option value="23">23</option>
                                <option value="24">24</option>
                                <option value="25">25</option>
                                <option value="26">26</option>
                                <option value="27">27</option>
                                <option value="28">28</option>
                                <option value="29">29</option>
                                <option value="30">30</option>
                                <option value="50">50</option>
                                <option value="100">100</option>
                                <option value="200">200</option>
                            </select>
                            个
                        </div>
                    </label>
                    <label>
                        &nbsp;总金额
                        <small>最低金额{php echo $fashb['hb_minmoney']}元</small>
                        <div class="field">
                            <input placeholder="填写金额" type="number" name="money" id="money">元
                        </div>
                    </label>
                    <div class="field null_title">
                        <textarea placeholder="恭喜发财，大吉大利！(限15字以内)" name="content" maxlength="15"></textarea>
                    </div>
                    <div class="field null_title">
                        <!--<input placeholder="留言" type="text" name="desk_name" style="width: 80%;">-->
                        <select name="nums" style="margin-right: 5%;width: 80px;">
                            <option value="1" selected>随机</option>
                            <option value="2">均分</option>
                        </select>
                    </div>
                    <p style="font-size: 10px;color: #CCC;text-align: right;" class="conts">系统将扣除{php echo $fashb['counter']}%手续费</p>
                </div>
            </div>
            <script>
                $('#money').bind('input propertychange', function() {
                      var mon= $(this).val()*(100+{php echo $fashb['counter']})/100;
                          mon = mon.toFixed(2);
                    $('.conts').html('本次合计支付'+mon+'元');
                });
            </script>
            <div class="mzh_modal_alert_footer">
                <!--<a class="mzh_btn_cancel">取消</a>-->
                <a class="mzh_btn_confirm hb_button">塞进红包</a>
            </div>

        </div>
    </div>

<div class="temp_bp_panel bp_panel" style="z-index: 9999;">
    <div class="mzh_modal_alert" style="display: block">
        <div class="mzh_modal_alert_dialog">
            <div class="mzh_modal_alert_title"><span id="title">霸屏</span><span class="am-icon-close close"></span></div>
            <div class="mzh_modal_alert_body">
    <div class="bp_tc">
        {loop $bpmoney $index $row}
       <div class="bp_tc_item {if $index==0}active{/if}" val="{$row['bp_time']}">
           <span class="time">{$row['bp_time']}秒/</span>￥{$row['bp_money']}
       </div>
        {/loop}
    </div>
    <div class="bp_ctx">
        <!--<form action="{php echo $this->createMobileUrl('Confirm_bp',array('id'=>$rid,'from_user'=>$page_from_user))}" method="post">-->
		{if $bp['is_img']==0||$bp['is_img']==1}
        <span class="bp_img_field">
			<img src="../addons/haoman_dpm/imgs/zp.png" style="display: none" class="for_video"/>
			<img src="../addons/haoman_dpm/imgs/zp.png" class="for_photo"/>
            <video src="" autoplay style="display: none;width: 15vw;height: 15vw; border-radius: 3px;border: 1px #dddddd solid;"></video>
            <input id="upload1" class="photo_file photo_file2" type="file" name="upload"  accept="video/*" capture="camera" style="display: none">
            <input id="upload2" class="photo_file" type="file" name="upload" accept="image/*"  onchange="imageUpLoad(this,2)">
		</span>
        <textarea placeholder="霸屏内容(限30字以内)" maxlength="30" name="content" style="resize: none;"></textarea>
      {else}
        <textarea placeholder="霸屏内容(限30字以内)" maxlength="30" name="content" style="resize: none;width: 100%"></textarea>
        {/if}
            <!--<textarea placeholder="霸屏内容(限30字以内)" maxlength="30" name="content" style="resize: none;width: 100%"></textarea>-->
            <input type="hidden" name="imgSrc" value="">
            <input type="hidden" name="bp_index" value="">
            <input type="hidden" name="type" value="2">
            <input type="hidden" name="nickname" value="">

        <!--</form>-->
    </div>
            </div>
            <div class="mzh_modal_alert_footer">
                <a class="mzh_btn_cancel">取消</a>
                <a class="mzh_btn_confirm ljbp">立即霸屏</a>
                </div>
            </div>
        </div>
</div>

<div id="rulebox" style="display:none;z-index: 99999999;">
        <div class="rulebody"><span id="bp_title" style="font-size:20px;text-align:center;color: #03bd01;display: block;">许愿</span>
            <div id="bapingImage"></div>
            <input name="bpfor" type="hidden" value="" id="bpfor"/>
            <div class="form-group1 row1" style="margin-top:20px;">
                <label class="control-label col-md-4"></label>
                <div class="col-md-8 xuyuan">
                    <div id="bapingQiehuan">
                        <textarea id="bapingContent"  class="form-control" name="content" style="margin-top:20px;width:92%; margin-left: 2%;margin-right: 2%;height:100px;border:1px solid #dcdcdc; overflow:hidden; resize:none;   padding: 2%;" placeholder="请不要发布广告涉黄等内容" ></textarea>
                    </div>
                </div>

            </div>
        </div>
        <div style="width:100%;height:30px;text-align:center;line-height: 30px;    margin: 4% auto 1%;">

            <button class="rulefoot1" type="button"   onClick="closeRule();" style="background:none;color:black;">取消</button>
            <button class="rulefoot1" type="button" style="width: 40%;" id="button">
                <input type="button" value="许愿" style="background:none;border: none;color: #fff;" id="bpSubmit"/>
                <input type="hidden" value="0" id="_type"/>
                <!--0表示许愿1表示霸屏-->
            </button>
        </div>

    </div>

    <div id="markser" style="z-index: 9999999"></div>
    <div id="toast"></div>

<div class="userBox">
    <div class="userBoxAllBg">
        <img class="userBg" />
    </div>
    <div class="userBoxCover">
        <div class="menu">
            <ul>

                <!--{if $bp['isbb']==1}-->
                <!--<li class="express_love">-->
                    <!--<i class="icon iconfont icon-aixin"></i>-->
                    <!--表白Ta-->
                <!--</li>-->
                <!--{/if}-->
                {if $bp['is_mf']==1}
                <li class="send_msg">私聊Ta</li>
                {/if}
                <!--{if $bp['is_gift']==1}-->
                <!--<li class="send_gift">-->
                    <!--<i class="icon iconfont icon-gift"></i>-->
                    <!--送礼物-->
                <!--</li>-->
                <!--{/if}-->
                <!--<li class="userTip">点击屏幕返回</li>-->
                <li>点击屏幕返回</li>

            </ul>
        </div>
    </div>
    <div class="reflectionBox"><img class="reflection"/></div>

</div>
<div class="right_indexs">
        <ul style="position: relative;">

            {if $bp['isbp']==1&& $money==1}
            <li class="wall_menu_chartss" onclick="haobang()"></li>
            {/if}
            <!--<li class="wall_menu_gb"></li>-->
        </ul>
</div>
<div class="right_index " style="display: block;{if $bp['ishb']==1}right: 0.5rem;{else}left:0.5rem;{/if};{if $fashb['is_messages']==1}bottom: 5%;{/if}">
    <ul style="position: relative;">
        {if $fashb['isfanshb']==1}
        <li class="wall_menu_hb"></li>
        {/if}
        {if $bp['isbp']==1&&$money==1}
        <li class="wall_menu_bp"></li>
        {/if}
        {if $bp['isds']==1}
        <li class="wall_menu_ds"></li>
        {/if}
        {if $bp['isvo']==1&& $money==1}
        <li class="wall_menu_video"></li>
        {/if}
        {if $xys['isxys']==0}
        <li class="wall_menu_charts" onclick="showrule();"></li>
        {/if}
        <!--{if $bp['is_gift']==1}-->
        <!--<li class="wall_menu_gift"></li>-->
        <!--{/if}-->
         {if $fashb['is_ty']==1}
        <li class="wall_menu_ty" onclick="go_ty();"></li>
        {/if}
        {if $bp['is_mf']==1}
        <li class="wall_menu_mf"></li>
        {/if}
    </ul>
</div>
<!--<div class="wall_menu_charts"></div>-->
<div class="mzh_modal_alert ds_panel">
    <div class="mzh_modal_alert_dialog" style="display: block">
        <div class="mzh_modal_alert_title">打赏<span class="am-icon-close close"></span></div>
        <div class="mzh_modal_alert_body">
            <div class="temp_ds_panel" id="ds-step-1">
                <div class="fl-slide-content">
                    <div class="ds_data"></div>
                </div>
                <div class="fl-slide-pager">
                    <ul></ul>
                </div>
                <p>请先选择打赏<span class="fl-strong">对象</span></p>
            </div>

            <div class="temp_ds_panel" id="ds-step-2">
                <div class="fl-slide-content">
                    <div class="fl-slide-panel"></div>
                </div>
                <div class="fl-slide-pager">
                    <ul></ul>
                </div>
                <div class="fl-slide-ds-text">
                    <input name="says" id="ds-field-says" placeholder="打赏语" maxlength="30"/>
                </div>
                <p>￥<span class="fl-strong ds-price">0.00</span> ，打赏给<span class="fl-strong ds-guest-name"></span></p>
                </div>
        </div>
        <input type="hidden" name="item_id" value="">
        <input type="hidden" name="guest_id" value="">
        <div class="mzh_modal_alert_footer">
            <div id="ds-step-opera-1">
                <a class="mzh_btn_cancel" id="ds-cancel-btn">取&nbsp;消</a>
                <a class="mzh_btn_confirm" id="ds-next-btn">选礼物</a>
            </div>

            <div id="ds-step-opera-2" class="fl-hide">
                <a class="mzh_btn_cancel" id="ds-back-btn">返&nbsp;回</a>
                <a class="mzh_btn_confirm" id="ds-confirm-btn">打&nbsp;赏</a>
            </div>
        </div>
    </div>
</div>

<div class="fl-template">
    <div class="fl-template-guest">
        <div class="fl-ds-guest" data-id="##id##">
            <img src="http://" class="fl-ds-guest-img"/>
            <p class="fl-ds-guest-name">##name##</p>
            <small class="fl-ds-guest-role">(##role##)</small>
            <div class="fl-ds-guest-mask"></div>
        </div>
    </div>

    <div class="fl-template-item">
        <div class="fl-ds-item" data-id="##id##" data-says="##says##">
            <img src="http://" class="fl-ds-item-img"/>
            <p class="fl-ds-item-name">##name##</p>
            <small class="fl-ds-item-price">##price##</small>
            <div class="fl-ds-item-mask"></div>
        </div>
    </div>
</div>
<div class="show_img_msg_box"show_video_msg_box>
	<img>
</div>
<div class="show_video_msg_box">
	<video src="" id="perform_video" loop controls></video>
</div>

    <div id="zhifu" style="display: none">

        <h4>订单信息</h4>

        <div class="panel">

            <div class="clearfix" style="padding-top:10px;">

                <p>商品名称 :<span class="pull-right otitle">{$params['title']}</span></p>

                <p>订单编号 :<span class="pull-right ordersn" >{$params['ordersn']}</span></p>

                <p>商家名称 :<span class="pull-right shangjia">{$_W['account']['name']}</span></p>

                <p>支付金额 :<span class="pull-right jine">￥{php echo sprintf('%.2f', $params['fee']);} 元</span></p>
            </div>

        </div>

        <div class="pay-btn" id="wechat-panel">

            <form action="{php echo url('mc/cash/wechat');}" method="post" id="biaodan">

                <input type="hidden" name="params" value=""  />

                <input type="hidden" name="token" value="{$_W['token']}" />

                <button class="weui_btn_primary weui_btn col-sm-12"  style="z-index: 9999;" type="submit" id="wBtn" value="wechat">微信支付(必须使用微信内置浏览器)</button>

            </form>

        </div>


    </div>

<script>
    function go_ty(){
        location.href = "{php echo $this->createMobileUrl("mob_bp_sq", array('id' => $rid))}";
    }
    function haobang(){
        location.href = "{php echo $this->createMobileUrl("haobang", array('rid' => $rid,'uid'=>$fans['from_user'],'type'=>'today'))}";
    }
    function showrule(){
        if (1 == isback)
        {
            $.tip("您已经被禁言,不能许愿了");
            return;
        }
        $(".content video").hide();
        var title='心愿';
        $("#bp_title").text(title);
        $("#markser").show();
        $("#bpSubmit").val("许愿");
        $("#rulebox").show();
        $("#_type").val("0");
    }
    function closeRule(){
        $("#rulebox").hide();
        $("#markser").hide();
    }



    $("#button").click(function () {
        var $btn = $(this);
        var $type =$("#_type").val();

        if ($btn.hasClass("disabled")) return;
        $btn.addClass("disabled");
        if($type==0){

            if (($("#bapingQiehuan textarea").val() == "") || ($("#bapingQiehuan textarea").val() == "null")) {
                $(".error_dialog p").html("请输入要许愿的话！");
                $(".error_dialog").show();
                setTimeout(function() {
                    $(".error_dialog").hide()
                }, 2000);
                $btn.removeClass("disabled");
                return;
            }else {
                var message = $("#bapingQiehuan textarea").val();
                if(!keyWord.check(message)){
                    $("#bapingQiehuan textarea").val('');
                    return $.tip('请勿发布广告等不适内容');
                }
//                console.log(message);
                //敏感词
                message = keyWord.replace(message);
            }
            $.ajax({
                url: '{php echo $this->createMobileUrl('savemessages',array('id'=>$rid,'from_user'=>$page_from_user))}',
                type: 'post',
                dataType: 'json',
                contentType: "application/x-www-form-urlencoded; charset=utf-8",
                data: {
                    "message": message,
                    "type": 1,
                },
                success: function(data) {
                    $btn.removeClass("disabled");
                    if (data.success == 1) {
                        $("#rulebox").hide();
                        $("#bapingQiehuan textarea").val("");
                        $("#markser").hide();
                        $(".content video").show();
                        $.tip("许愿成功！！")
                    } else {
                        $(".content video").show();
                        $.tip(data.msg)
                        return;
                    }
                },
                error: function() {
                    window.location.reload();
                }
            });
        }



    })
    {if $bp['bp_pay2']==1}
    $(".ljbp").click(function(){

        var e = $.trim($(".bp_ctx textarea").val()), a = $("input[name=imgSrc]").val();
        if("" == e&& "" == a){
            $.tip("请填写霸屏内容或图片");
            return;
        }else {
            if(!keyWord.check(e)){
                $(".bp_ctx textarea").val('');
                return $.tip('请勿发布广告等不适内容');
            }

            //敏感词
            e = keyWord.replace(e);
        }
        var prizeid =$(".bp_tc .active").attr("val");
        var isbp_v =$("input[name=type]").val();
        if(isbp_v==5){
            var nickname =$("input[name=nickname]").val();
        }else {
            var nickname ='';
        }
        var submitData = {
            "message": e,
            "pbtime": prizeid,
            "bppic": a,
            "type": isbp_v,
            "forTa_nickname": nickname,
        };

        $.post("{php echo $this->createMobileUrl('Confirm_bp',array('token'=>'onBridge','id'=>$rid,'from_user'=>$page_from_user))}", submitData,function(data){

            if(data.success == 1&&data.isadmin==0){
                var result = data.arr;
                $(".otitle").empty().append(result.xq);

                $(".ordersn").empty().append(result.ordersn);

                $(".shangjia").empty().append(result.title);

                $(".jine").empty().append(result.fee);

                $("input[name='params']").val(data.params);
                $("#biaodan").submit();
//                    $("#wBtn").click();

            }else if(data.success == 1&&data.isadmin==1){

                $(".bp_ctx textarea").val("");
                $(".bp_img_field img").attr("src", "../addons/haoman_dpm/imgs/zp.png");
                $(".bp_panel").hide();
                $(".content video").show();
            }
            else {
                $(".content video").show();
                alert(data.msg)
            }
        },'json');
    })

    //打赏
    $("#ds-confirm-btn").click(function(){
        var item_id =$("input[name=item_id]").val();
        var guest_id =$("input[name=guest_id]").val();
        var megs =$("#ds-field-says").val();

        if (guest_id > 0 && item_id > 0) {
            var submitData = {
                "guest_id": guest_id,//被打赏人的id
                "item_id": item_id,//奖品ID
                "message": megs,//说的话
                "type":3,
            };
            $.post('{php echo $this->createMobileUrl('Confirm_dpmds',array('token'=>'onBridge','id'=>$rid))}',submitData, function(data) {

                $("input[name=item_id]").val('');
                $("input[name=guest_id]").val('');
                $("#ds-step-1").hide();
                $("#ds-step-2").hide();
                $(".ds_panel").hide();
                $("#ds-step-1").show();
                $("#ds-step-opera-1").show();
                $("#ds-step-2").hide();
                $("#ds-step-opera-2").hide();
                $(".fl-ds-guest.selected").removeClass("selected");
                $(".content video").show();
                if(data.success == 1&&data.isAdmin==0){
                    var result = data.arr;
                    $(".otitle").empty().append(result.xq);

                    $(".ordersn").empty().append(result.ordersn);

                    $(".shangjia").empty().append(result.title);

                    $(".jine").empty().append(result.fee);

                    $("input[name='params']").val(data.params);
                    $("#biaodan").submit();
                }else if(data.success == 1&&data.isAdmin==1){
                    $.tip("打赏成功")
                }else{
                    $.tip(data.msg);
                }
            },'json');


        }else {
            $(".content video").show();
            $.tip("请选择打赏对象、打赏礼物")
        }

    })

    //发红包
    $(".hb_button").click(function(){
        var m =$("input[name=money]").val();
        var n =$("select[name=num]").val();
        var c =$.trim($(".hb_panel textarea").val());
        var d =$("select[name=nums]").val();

        if(m<rpMinMoney){
            $.tip("红包总金额不低于" + rpMinMoney + "元")
            return;
        }
        if(m>rpMaxMoney&&rpMaxMoney>=rpMinMoney&&rpMaxMoney!=0){
            $.tip("红包总金额不能大于" + rpMaxMoney + "元")
            return;
        }
        if(n<1){
            $.tip("红包个数不低于1个");
            return;
        }
        if(hbtype==0){
           if(m/n>200){
               $.tip("每人每次最多可领取红包金额200元");
               return;
           }
        }
        var submitData = {
            "message": c,
            "pbtime": n,
            "bppic": m,
            "desk": d,
            "type": 4,
        };

        $.post('{php echo $this->createMobileUrl('Confirm_dpmhb',array('token'=>'onBridge','id'=>$rid))}',submitData, function(data) {

            $(".hb_panels").hide();
            $("input[name=money]").val('');
            $("select[name=num]").val('2');
            $(".hb_panel textarea").val('');
            $("select[name=nums]").val('1');
            $(".content video").show();
            if(data.success == 1&&data.isAdmin==0){
                var result = data.arr;
                $(".otitle").empty().append(result.xq);

                $(".ordersn").empty().append(result.ordersn);

                $(".shangjia").empty().append(result.title);

                $(".jine").empty().append(result.fee);

                $("input[name='params']").val(data.params);
                $("#biaodan").submit();
            }else if(data.success == 1&&data.isAdmin==1){
                $.tip("红包发送成功！")
            }else{
                $.tip(data.msg);
            }
        },'json');


    })

    {else if $bp['bp_pay2']==2}
    $(".ljbp").click(function(){

        var e = $.trim($(".bp_ctx textarea").val()), a = $("input[name=imgSrc]").val();
        if("" == e&& "" == a){
            $.tip("请填写霸屏内容或图片");
            return;
        }else {
            if(!keyWord.check(e)){
                $(".bp_ctx textarea").val('');
                return $.tip('请勿发布广告等不适内容');
            }

            //敏感词
            e = keyWord.replace(e);
        }
        var prizeid =$(".bp_tc .active").attr("val");
        var isbp_v =$("input[name=type]").val();
        if(isbp_v==5){
            var nickname =$("input[name=nickname]").val();
        }else {
            var nickname ='';
        }
        var submitData = {
            "message": e,
            "pbtime": prizeid,
            "bppic": a,
            "type": isbp_v,
            "forTa_nickname": nickname,
        };

        $.post("{php echo $this->createMobileUrl('Confirm_bp',array('id'=>$rid,'from_user'=>$page_from_user))}", submitData,function(data){

            if(data.success == 1&&data.isadmin==0){
                location.href="{php echo $this->createMobileUrl('pay',array('pay_type' => 2))}&orderid="+data.orderid;

            }else if(data.success == 1&&data.isadmin==1){

                window.location.reload();
            }
            else {
                $(".content video").show();
                alert(data.msg)
            }
        },'json');
    })

    $("#ds-confirm-btn").click(function(){
        var item_id =$("input[name=item_id]").val();
        var guest_id =$("input[name=guest_id]").val();
        var megs =$("#ds-field-says").val();

        if (guest_id > 0 && item_id > 0) {
            var submitData = {
                "guest_id": guest_id,//被打赏人的id
                "item_id": item_id,//奖品ID
                "message": megs,//说的话
                "type":3,
            };
            $.post('{php echo $this->createMobileUrl('Confirm_dpmds',array('id'=>$rid))}',submitData, function(data) {

                $("input[name=item_id]").val('');
                $("input[name=guest_id]").val('');
                $("#ds-step-1").hide();
                $("#ds-step-2").hide();
                $(".ds_panel").hide();
                $("#ds-step-1").show();
                $("#ds-step-opera-1").show();
                $("#ds-step-2").hide();
                $("#ds-step-opera-2").hide();
                $(".fl-ds-guest.selected").removeClass("selected");
                $(".content video").show();
                if(data.success == 1&&data.isAdmin==0){
                    location.href="{php echo $this->createMobileUrl('pay',array('pay_type' => 3))}&orderid="+data.orderid;
                }else if(data.success == 1&&data.isAdmin==1){
                    $.tip("打赏成功")
                }else{
                    $.tip(data.msg);
                }
            },'json');


        }else {
            $(".content video").show();
            $.tip("请选择打赏对象、打赏礼物")
        }

    })

    $(".hb_button").click(function(){
        var m =$("input[name=money]").val();
        var n =$("select[name=num]").val();
        var c =$.trim($(".hb_panel textarea").val());
        var d =$("select[name=nums]").val();

        if(m<rpMinMoney){
            $.tip("红包总金额不低于" + rpMinMoney + "元")
            return;
        }
        if(m>rpMaxMoney&&rpMaxMoney>=rpMinMoney&&rpMaxMoney!=0){
            $.tip("红包总金额不能大于" + rpMaxMoney + "元")
            return;
        }
        if(n<1){
            $.tip("红包个数不低于1个");
            return;
        }
        if(hbtype==0){
            if(m/n>200){
                $.tip("每人每次最多可领取红包金额200元");
                return;
            }
        }
        var submitData = {
            "message": c,
            "pbtime": n,
            "bppic": m,
            "desk": d,
            "type": 4,
        };

        $.post('{php echo $this->createMobileUrl('Confirm_dpmhb',array('id'=>$rid))}',submitData, function(data) {

            $(".hb_panels").hide();
            $("input[name=money]").val('');
            $("select[name=num]").val('2');
            $(".hb_panel textarea").val('');
            $("select[name=nums]").val('1');
            $(".content video").show();
            if(data.success == 1&&data.isAdmin==0){
                location.href="{php echo $this->createMobileUrl('pay',array('pay_type' => 4))}&orderid="+data.orderid;
            }else if(data.success == 1&&data.isAdmin==1){
                $.tip("红包发送成功！")
            }else{
                $.tip(data.msg);
            }
        },'json');


    })
    {else}
    $(document).ready(function(){
        document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {

            var click=false;
            $(".ljbp").click(function(){
                        if(click){
                            return $.tip("请不要频繁点击");
                        }
                click=true;
                var e = $.trim($(".bp_ctx textarea").val()), a = $("input[name=imgSrc]").val();
                if("" == e&& "" == a){
                    click=false;
                    $.tip("请填写霸屏内容或图片");
                    return;
                }else {
                    if(!keyWord.check(e)){
                    $(".bp_ctx textarea").val('');
                        click=false;
                    return $.tip('请勿发布广告等不适内容');
                }

                    //敏感词
                    e = keyWord.replace(e);

                }
                var prizeid =$(".bp_tc .active").attr("val");
                var isbp_v =$("input[name=type]").val();
                if(isbp_v==5){
                    var nickname =$("input[name=nickname]").val();
                }else {
                    var nickname ='';
                }

                var submitData = {
                    "message": e,
                    "pbtime": prizeid,
                    "bppic": a,
                    "type": isbp_v,
                    "forTa_nickname": nickname,
                };

                $.post('{php echo $this->createMobileUrl('Confirm_bp',array('id'=>$rid))}',submitData, function(idata) {

                    if(idata.success == 1&&idata.isadmin==0){
                        click=false;
                        $(".bp_ctx textarea").val("");
                        $(".bp_img_field img").attr("src", "../addons/haoman_dpm/imgs/zp.png");
                        $(".bp_panel").hide();
                        $(".content video").show();
                        util.pay({
                            orderFee : idata.pay_money,
                            payMethod : 'wechat',
                            orderTitle : '霸屏'+idata.pay_money+'元',
                            orderTid : idata.tid,
                            module : 'haoman_dpm',
                            success : function(result) {
                                click=false;
                                $.tip("霸屏成功！！");
                                //location.href="{php echo $_W['siteroot'].$this->createMobileUrl('results')}&tid="+idata.orderid;
                            },
                            fail : function(result) {
                                click=false;
                                alert('fail : ' + result.message);
                            },
                            complete : function(result) {
                                //location.reload();
                            }
                        });
                    }else if(idata.success == 1&&idata.isadmin==1){
                        click=false;
                        $(".bp_ctx textarea").val("");
                        $(".bp_img_field img").attr("src", "../addons/haoman_dpm/imgs/zp.png");
                        $(".bp_panel").hide();
                        $(".content video").show();
                    }else{
                        click=false;
                        $(".content video").show();
                        $.tip(idata.msg);
                    }
                },'json');

            })

            $("#ds-confirm-btn").click(function(){
                if(click){
                    return $.tip("请不要频繁点击");;
                }
                click=true;
                var item_id =$("input[name=item_id]").val();
                var guest_id =$("input[name=guest_id]").val();
                var megs =$("#ds-field-says").val();
                if (guest_id > 0 && item_id > 0) {

                    var submitData = {
                        "guest_id": guest_id,//被打赏人的id
                        "item_id": item_id,//奖品ID
                        "message": megs,//说的话
                        "type":3,
                    };

                    $.post('{php echo $this->createMobileUrl('Confirm_dpmds',array('id'=>$rid))}',submitData, function(idata) {
                        click=false;
                        $("input[name=item_id]").val('');
                        $("input[name=guest_id]").val('');
                        $("#ds-step-1").hide();
                        $("#ds-step-2").hide();
                        $(".ds_panel").hide();
                        $("#ds-step-1").show();
                        $("#ds-step-opera-1").show();
                        $("#ds-step-2").hide();
                        $("#ds-step-opera-2").hide();
                        $(".fl-ds-guest.selected").removeClass("selected");
                        $(".content video").show();
                        if(idata.success == 1&&idata.isAdmin==0){
                            util.pay({
                                orderFee : idata.pay_money,
                                payMethod : 'wechat',
                                orderTitle : '打赏'+idata.pay_money+'元',
                                orderTid : idata.tid,
                                module : 'haoman_dpm',
                                success : function(result) {
                                    $.tip("打赏成功！！");
                                    //location.reload();
                                    //location.href="{php echo $_W['siteroot'].$this->createMobileUrl('results')}&tid="+idata.orderid;
                                },
                                fail : function(result) {
                                    alert('fail : ' + result.message);
                                },
                                complete : function(result) {
                                    //location.reload();
                                }
                            });
                        }else if(idata.success == 1&&idata.isAdmin==1){
                            $(".content video").show();
                            $.tip("打赏成功!")
                        }else{
                            $(".content video").show();
                            $.tip(idata.msg);
                        }
                    },'json');


                } else {
                    $(".content video").show();
                    click=false;
                    $.tip("请选择打赏对象、打赏礼物")
                }


            })

            $(".hb_button").click(function(){
                if(click){
                    return;
                }
                click=true;
                var m =$("input[name=money]").val();
                var n =$("select[name=num]").val();
                var c =$.trim($(".hb_panel textarea").val());
                var d =$("select[name=nums]").val();

                if(m<rpMinMoney){
                    $.tip("红包总金额不低于" + rpMinMoney + "元");
                    click=false;
                    return;
                }
                if(m>rpMaxMoney&&rpMaxMoney>=rpMinMoney&&rpMaxMoney!=0){
                    $.tip("红包总金额不能大于" + rpMaxMoney + "元")
                    return;
                }
                if(n<1){
                    $.tip("红包个数不低于1个");
                    return;
                }
                if(hbtype==0){
                    if(m/n>200){
                        $.tip("每人每次最多可领取红包金额200元");
                        return;
                    }
                }
                var submitData = {
                    "message": c,
                    "pbtime": n,
                    "bppic": m,
                    "desk": d,
                    "type": 4,
                };

                $.post('{php echo $this->createMobileUrl('Confirm_dpmhb',array('id'=>$rid))}',submitData, function(data) {
                    click=false;
                    $(".hb_panels").hide();
                    $("input[name=money]").val('');
                    $("select[name=num]").val('2');
                    $(".hb_panel textarea").val('');
                    $("select[name=nums]").val('1');
                    $(".content video").show();
                    if(data.success == 1&&data.isAdmin==0){
                        util.pay({
                            orderFee : data.pay_money,
                            payMethod : 'wechat',
                            orderTitle : '发红包'+data.pay_money+'元',
                            orderTid : data.tid,
                            module : 'haoman_dpm',
                            success : function(result) {
                                $.tip("红包发送成功！！");
                                //location.reload();
                                //location.href="{php echo $_W['siteroot'].$this->createMobileUrl('results')}&tid="+idata.orderid;
                            },
                            fail : function(result) {
                                alert('fail : ' + result.message);
                            },
                            complete : function(result) {
                                //location.reload();
                            }
                        });
                    }else if(data.success == 1&&data.isAdmin==1){
                        $(".content video").show();
                        $.tip("红包发送成功！")
                    }else{
                        $(".content video").show();
                        $.tip(data.msg);
                    }
                },'json');


            })
        });
    });

    {/if}


    $(".close,.mzh_btn_cancel").click(function(){

        $(".bp_ctx textarea").val("");
        $(".bp_img_field video").hide();
        $(".bp_img_field img").show();
        $(".bp_img_field img").attr("src", "../addons/haoman_dpm/imgs/zp.png");
        $(".bp_panel").hide();
        $(".hb_panels").hide();
        $("input[name=money]").val('0');
        $("select[name=num]").val('2');
        $(".hb_panel textarea").val('');
        $("select[name=nums]").val('1');
        $(".content video").show();

    })


</script>
    <script src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
    <!--<script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>-->
    <script type="text/javascript">
        wx.config({
            debug:false,
            appId: '{$package["appId"]}',
            timestamp: '{$package["timestamp"]}',
            nonceStr: '{$package["nonceStr"]}',
            signature: '{$package["signature"]}',
            jsApiList: [
                'checkJsApi',
                'onMenuShareTimeline',
                'onMenuShareAppMessage',
                'onMenuShareQQ',
                'onMenuShareWeibo',
                'hideMenuItems',
                'showMenuItems',
                'hideAllNonBaseMenuItem',
                'showAllNonBaseMenuItem',
                'translateVoice',
                'startRecord',
                'stopRecord',
                'onRecordEnd',
                'playVoice',
                'pauseVoice',
                'stopVoice',
                'uploadVoice',
                'downloadVoice',
                'chooseImage',
                'previewImage',
                'uploadImage',
                'downloadImage',
                'getNetworkType',
                'openLocation',
                'getLocation',
                'hideOptionMenu',
                'showOptionMenu',
                'closeWindow',
                'scanQRCode',
                'chooseWXPay',
                'openProductSpecificView',
                'addCard',
                'chooseCard',
                'openCard'
            ]
        });
        var sharedata = {
            "imgUrl" : "{$shareimg}",
            "link" : "{$sharelink}",
            "desc" : "{$sharedesc}",
            "title" : "{$sharetitle}"
        };

        wx.ready(function () {
            {if $reply['is_b_share'] == 2}
            wx.hideOptionMenu();
            {else}
            wx.showOptionMenu();
            wx.onMenuShareAppMessage(sharedata);
            wx.onMenuShareTimeline(sharedata);
            wx.onMenuShareQQ(sharedata);
            wx.onMenuShareQZone(sharedata);
            wx.onMenuShareWeibo(sharedata);
            {/if}
        });

    </script>

    <script type="text/javascript">
        //单图上传
        $('.photo_filea').on('click', function () {

            wx.chooseImage({
                count:1,
                sizeType: ['', 'compressed'], // 可以指定是原图还是压缩图，默认二者都有
                sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机，默认二者都有
                success: function (res) {
                    var localIds = res.localIds;

                    syncUpload1(localIds);
                }
            });
        });

        $('.for_photo22').on('click', function () {
            wx.chooseImage({
                count:1,
                sizeType: ['', 'compressed'], // 可以指定是原图还是压缩图，默认二者都有
                sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机，默认二者都有
                success: function (res) {

                    var localIds = res.localIds;

                    syncUpload2(localIds);
                }
            });
        });
        var syncUpload1 = function(localIds){

            var localId = localIds.pop();

            wx.uploadImage({
                localId: localId,
                isShowProgressTips: 1,
                success: function (res) {

                    var serverId = res.serverId; // 返回图片的服务器端ID
                    $.post(save_Image,{mid:serverId},function(data){

                        $.getJSON(go_sendmsg, {image: data.v}, function (i) {
                            $.tip(i.data);
                             a.loadmsg();
                        })
                    },'json');


                }

            });
        };
        var syncUpload2 = function(localIds){

            var localId = localIds.pop();

            wx.uploadImage({
                localId: localId,
                isShowProgressTips: 1,
                success: function (res) {
                    var serverId = res.serverId; // 返回图片的服务器端ID
                    $.post(save_Image,{mid:serverId},function(data){

                        $('.for_photo').attr("src", data.src);
                        $("input[name=imgSrc]").val(data.v), n = data.src
                    },'json');


                }

            });
        };

    </script>

    <script type="text/javascript">
        var upload = {
            start:function(){
                $.loadingModal(!0, "上传中..");
            },
            done:function(src,bigSrc,type){
                if(type==2){
                    $.loadingModal(!1)
                    $('.for_photo').attr("src", src);
                    $("input[name=imgSrc]").val(src), n = src
                }else {

                    $.getJSON(go_sendmsg, {image: src}, function (i) {
                        $.loadingModal(!1)
                        $.tip(i.data);
                        if(i.times>0){
                            $(".game_time").show();
                            countDown(i.times);
                        }

                        a.loadmsg();

                    })
                }
            },
            error:function(errorMsg){
                $.loadingModal(!1)
                alert(errorMsg)
//                showInfo(errorMsg||'上传失败!',false);
            }
        }
        var imageUpLoad = function(e,type){
            upload.start();
            selectFileImage(e,{
                width:200,height:200,
                error:function(errorMsg){upload.error(errorMsg||'请上传宽高大于200px的图片')},
                callback:function(base64,rotate){
                    ajax_imageUpload(base64,rotate,function(src,bigSrc){
                        upload.done(src,bigSrc,type);
                    },function(errorMsg){
                        upload.error(errorMsg);
                    })
                }
            })
        }
        var ajax_imageUpload = function(base64,rotate,fn1,fn2){
            base64 = base64.split('base64,');
            if(base64.length<1)
                return fn2();
            base64 = base64[1];
            var resultMsg = null;
            $.post(uploadImg,{strImg:base64,angel:rotate},function(result) {

                if(result.isResultTrue){
                    fn1(result.resultMsg.sImgUrl,result.resultMsg.bImgUrl);
                }else{
                    fn2(result.resultMsg);
                }
            });
        }
    </script>
</body>
</html>
